package main

import (
	"fmt"
	"time"
)

func main() {
	now := time.Now()
	fmt.Println(now.Format("2006-01-02 15:04:05"))
	fmt.Println(1111, now.Weekday())

	last := now.Add(10 * time.Second)

	fmt.Println(last.Before(now))
	fmt.Println(2222, time.Until(last).Seconds())
	fmt.Println(33333, time.Duration(10).Seconds())
	fmt.Println(44444, time.Until(last).Seconds() > 10)

	to, _ := time.Parse("2006-01-02T15:04:05Z", "2021-01-27T10:10:10.294Z")
	stamp := to.Format("2006-01-02 15:04:05")
	fmt.Println(stamp)
	//日期字符串转Time
	t, _ := time.ParseInLocation("20060102", "20220425", time.Local)
	fmt.Println(t)

	date := "2023-07-10"
	start := "16:00:00"
	t1, _ := time.Parse("2006-01-02 15:04:05", fmt.Sprintf("%s %s", date, start))

	fmt.Println(555555, t1.Add(-12*time.Second).Weekday())
}
